package com.api.shopapi.service.impl;

import com.api.shopapi.entity.UserDevice;
import com.api.shopapi.entity.dto.UserDeviceDTO;
import com.api.shopapi.mapper.UserDeviceMapper;
import com.api.shopapi.service.UserDeviceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("UserDeviceServiceImplOne")
public class UserDeviceServiceImpl  implements UserDeviceService {

    @Autowired
    private UserDeviceMapper userDeviceMapper;


    @Override
    public int insert(UserDevice userDevice) {
        return userDeviceMapper.insert(userDevice);
    }

    @Override
    public int update(UserDevice userDevice) {
        return userDeviceMapper.update(userDevice);
    }

    @Override
    public UserDevice getByUserDeviceCode(String userDeviceCode) {
        return userDeviceMapper.getByUserDeviceCode(userDeviceCode);
    }

    @Override
    public UserDevice getByUserCode(String userCode) {
        return userDeviceMapper.getByUserCode(userCode);
    }

    @Override
    public UserDeviceDTO getForUserDeviceDTO(String userCode) {
        return userDeviceMapper.getForUserDeviceDTO(userCode);
    }
}
